Contents


• Introduction
• "Need to Know"
• Basic Setup
• Chat Commands
• Animation Triggers
• Scene Rezzer Overview
• Rezzer UI Script
• Kill Script
• Float script

Introduction


Prim Puppeteer is a set of scripts that will help animate your creation. Similar to stop-motion animation, the system works by taking snapshots of your prim's positions and allowing you to play back the recorded snapshots.

No coding is required to to use Puppeteer. However, if you are a scripter, you can further control the animation through linked message calls. (Please read the "Scripter's Guide" section.)

For starters, you need the program, Prim Puppeteer (v8.0 at this writing).

"Need to Know"


To use Puppeteer, need some basic understanding of the root prim. Here are some quick facts you need to know:

• There is only one root prim per link set.
• A root prim has a yellow border around it during editing.
• Link prims have blue borders around them during editing.
• The Root prim will always be the last prim you select before using the Tools->Link command.
• Puppeteer only moves link prims.
• All movements are relative to the root prim.

Tip: Use an invisible root prim if you wish to create the illusion of the entire object moving.

Tip: Be sure to click the “Edit linked parts” check box in order to move the linked prims.

Basic Setup


The easiest way to set up Puppeteer is by following the steps in Quick Start Instructions. Detailed information is available on the notecard provided with Prim Puppeteer.

1.) Add all three Puppeteer scripts into the object you want to animate.
2.) Right-click the object, select 'Take' and then rez the object from your inventory.
3.) Right-click the object and select 'Edit...' then select 'Tools -> Set Scripts to Running in Selection' from the top menu bar. After setup is complete, the “Puppeteer Link” script will delete itself from the root prim.
4.) Type: /32 menu to bring up the P.P. menu. To record snapshots with Puppeteer, type “/32 menu” to bring up the Edit Menu. After moving the prims around, simply click the “record” button to take a snapshot.

A snapshot in Puppeteer is simply a recording of all link prim's position, rotation, and size/scale. This has nothing to do with actually taking screenshots.

Chat Commands


Puppeteer supports a lot more commands than those shown on the Edit Menu. To see all possible commands, click the “help” button on the menu or type “/32 help”.

Full chat command list:

/32 menu
brings up the Editing Menu (a must)!

/32 show <snapshot number>
will display a specific snapshot.
For example, “/32 show 2” will show snapshot #2.

Tip: You can drag the Puppeteer Editor script back into the object to unpublish and re-edit at any time. Please also note that you will not be able to edit other people's recordings.

/32 play
is similar to pressing the “play button” on the Editing Menu. The difference is that through chat command, you can loop the animation as well as set the play speed.
For example, “/32 play loop” will play the animation non-stop;
“/32 play 0.5” will play the animation with only a 0.5 second delay between snapshots; and
“/32 play loop 2.0” will play animation non-stop with a two second delay between snapshots. Note that 0.1 second delay between snapshots is the fastest allowed play speed.

/32 rplay
is very similar to the “/32 play” command except that it plays the animation in reverse order. You can also make this command loop or change the play speed.

/32 trigger
is the same as pressing the “trigger” button on the Editing Menu. It will allow you to customize playback behavior. The triggers are only active after you publish. Please see the “Triggers & Playback Customization” section for more detail.

/32 delete <snapshot number>
This command will delete the snapshot specified.
For example, “/32 delete 3” will delete snapshot number #3.

/32 replace <snapshot number>
will record the current prim positions over the given snapshot. It is similar to the “/32 record” command except that the snapshot is not added to the end. Instead, the snapshot will replace number specified.
For example, “/32 replace 2” will take a new snapshot and replace snapshot #2.

/32 insert <snapshot number>
will record a new snapshot and add it right before the specified snapshot.
For example, “/32 insert 4” will record a new snapshot and add it before the existing snapshot #4. So old snapshot #4 is now snapshot #5 and the rest of the snapshots are all shifted down.

/32 reset
will delete all recorded snapshots.

/32 status
shows how many snapshots have been recorded. The number of recorded snapshots is also visible on the Edit Menu.

/32 export
will export/print out all the recorded snapshots to the chat window for copying and pasting into notecards. (Due to Second Life's notecard size limitation, the export may span multiple notecards.)
It is important to make sure the chat window is wide enough so the lines do not wrap around.
Note that playback settings are not part of the export. Only the recorded snapshots are exported.

/32 import <notecard name>
s a Vendor Edition only command. It is used to import the snapshots with the “/32 export” command. See the “Importing from Notecard” section above for more details.

/32 purge
This command will delete ALL puppeteer scripts from the object. This can be used in conjunction with import/export command to upgrade to future versions of Puppeteer.

/32 removeunusedscripts
will look at the currently recorded animation and delete all Puppeteer Link scripts that would not affect the animation. Basically, any prim that has not moved, rotated, or resized will have its script deleted from it. This is great for general optimzation. However, should you need to animate those prims again, you will have to add the Puppeteer Link scripts manually. It may also disrupt the anchoring feature of Puppeteer.

/32 channel <new channel number>
allows you to change the channel that the chat commands use. Please keep in mind that all chat commands are already restricted to owner only. Therefore there's no chance for conflict with other nearby Puppeteer users. This command only exists for personal preference.
For example, “/32 channel 3” specifies that from now on all commands listen on channel 3. To bring up the menu, you would use “/3 menu”.

Animation Triggers


[ On-Touch ]
will activate the animation when you click the object. Click the object again to stop the animation. This is the default trigger.

[ On-Chat ]
will activate the animation when a specific chat phrase is 'heard.' After selecting On-Chat, you will see another menu, allowing you to customize the start and stop phrase as well as the listening channel. If the start and stop are set to the same phrase, you can use the chat phrase as an on and off toggle.

[ On-Rez ]
will start the animation as soon as an object is dragged from the inventory into the world.

[ On-Collision ]
will start the animation when you bump into or step on the object. You can use this trigger to activate an animation when someone is near it by having one of the prims covering the floor so residents can step on it.

Please Note: SL's collision detection is not always reliable, especially when things are laggy. It is best to use On-collision triggers with play-once style rather than loop or ping-pong.

[ On-Sit ]
will start the animation when someone sits on the object. Make sure you adjust the set position using another script to get the desired effect.

[ On-Chance ]
will fire base on the percentage and the interval you specify. It is great for ambient animations. It will not activate if other trigger animations are currently playing. There are two exceptions to this, On-rez loops, and On-chance loops.

[ On-Fly ]
will only activate when the animated object is attached to an avatar. The trigger activates when the avatar is flying. This is useful for making wings or jet packs.

[ On-Walk ]
will only activate when the animated object is attached to an avatar. It triggers when the avatar is walking. You can use this trigger to create attachment based vehicles that animate when the avatar walks.

[ On-Typing ]
will only activate when the animated object is attached to an avatar. The trigger activates when the user is typing in chat. It is possible to make objects that pop up when you are typing and shrink back into the avatar's chest when typing has stopped. Note that the On-Typing trigger will not work if the avatar has typing animations disabled.

Scene Rezzer Overview


Once you have them recorded, you will want to manage your animations. Having the scene pack up when it has been played will reduce prim count on your region. The only time the prims are on the island is when the scene is actually being played.

You can do this with a rezzer script. Since all the prims are already linked together for P.P. Animation, this is easy.

Create a object that will serve as the rezzer. This can be a terminal, sign or any prim you like. Place the code below into a script and then place the script into the chosen rezzer-object along with the actual scene.

When you have copied and pasted the code into a script, right-click and edit your rezzer object. Go into the contents tab and place the script and the scene object into the contents.

With this script, when an avatar touches the object, a menu will appear. The menu will give the option to load, clear, play, or stop the scene.

Rezzer UI Script


list choices = ["Load Scene", "Play Scene", "Stop Scene", "Clear Scene"];
 string stored;
 
//The listening channel of the dialog box
//This should be altered for every script that is a close
//vicinity of another using the same channel
integer channel_dialog = -3000;
 
default {
 
state_entry()
     {
//This will sense if anyone is in the area, if not it sends a signal to "kill" script
//see kill script below
    llSensorRepeat("", "", AGENT, 20.0, PI, 15.0);
    }
 
   touch_start(integer total_number)
    {
       //Intial Welcome Message
        llDialog(llDetectedKey(0),"\nPlease choose an option:\n",choices, channel_dialog);
 
          llListen( channel_dialog, "", stored, "" );
 
    }
 
       listen(integer channel, string name, key id, string choice)
       {
 
           if (choice == "Load Scene")
          {
             //Rezobject function
         vector eul = <0,0,180>; //45 degrees around the z-axis, in Euler form
        eul *= DEG_TO_RAD; //convert to radians
        rotation quat = llEuler2Rot(eul); //convert to quaterniondefault
 
        // This line will pick the first object out of the container and rez it
//The vector currently shown as <5,8,1> as well as the rotation vector above
//can be manipulated to determine placement for the rez.
        llRezObject(llGetInventoryName(INVENTORY_OBJECT,0), llGetPos()+<5,8,1>,ZERO_VECTOR,quat,0);
        }
  if (choice == "Play Scene")
    {
//The start trigger channel, in this case -900, must be defined in P.P.
//before publishing
    llSay(-900, "start");
    llSleep(21);
//This "float" and "float2" sends a message to 2 different script in the scene
//  after a period of time [llSleep()] on channel -800. This can be used
//to create dialogue in the form of chat or floating text. The sleep delay
//is used to get the timing just right, see "float" script for example.
  llSay(-800,"float");
          llSleep(22);
  llSay(-800,"float2");
 
}
 
   if (choice == "Stop Scene")
      {
//channel and trigger, like "start" must be defined in P.P. before publishing
          llSay(-900, "stop");
         }
 
      if (choice == "Clear Scene")
    {
//Like the sensor this is a manual way of sending the "kill" message to the
//scene, see the "kill script" below
         llSay(-900, "kill");
    }
      }
            sensor(integer num_detected)
    {
    }
    no_sensor()
    {
        llSay(-900,"kill");
    }
}
 
 

Kill Script

(place into scene after publishing)

default
{
    state_entry()
    {
       llListen( -900, "", NULL_KEY, "" );
    }
 
      listen(integer channel, string name, key id, string message)
    {
               if (message == "kill")
        {
                       llDie();
        }
    }
}

Float Script

(place into specific prim/NPC after publishing)

default
{
    state_entry()
    {
        llListen(-800, "", NULL_KEY, "" );
    }
 
    listen(integer channel, string name, key id, string message)
       {
 
           if (message == "float2")
           {
     llSetText("Don't Worry we'll get you fixed up\n \n \n  ", <1.0, 1.0, 1.0>, 1.0);
     llSay(0,"Don't Worry we'll get you fixed up");
     llSleep(3);
     llSetText("",<1,1,1>,1.0);
 
        }
        }
 
}



Continue to Chapter 10 - Animating Avatars